<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/base}">
<head>
    <title>登录 - 暖心助农选品平台</title>
</head>
<body>
    <div layout:fragment="content">
        <div class="row justify-content-center">
            <div class="col-md-6">
                <div class="card">
                    <div class="card-header">
                        <h4 class="mb-0">用户登录</h4>
                    </div>
                    <div class="card-body">
                        <form th:action="@{/login}" method="post">
                            <div th:if="${param.error}" class="alert alert-danger">
                                用户名或密码错误
                            </div>
                            <div th:if="${param.logout}" class="alert alert-success">
                                您已成功退出
                            </div>
                            
                            <div class="mb-3">
                                <label for="username" class="form-label">用户名</label>
                                <input type="text" class="form-control" id="username" name="username" required>
                            </div>
                            
                            <div class="mb-3">
                                <label for="password" class="form-label">密码</label>
                                <input type="password" class="form-control" id="password" name="password" required>
                            </div>
                            
                            <div class="mb-3">
                                <div class="form-check">
                                    <input type="checkbox" class="form-check-input" id="remember-me" name="remember-me">
                                    <label class="form-check-label" for="remember-me">记住我</label>
                                </div>
                            </div>
                            
                            <button type="submit" class="btn btn-primary">登录</button>
                            <a th:href="@{/register}" class="btn btn-link">注册新账号</a>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>